﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Collections;

namespace ServidorCobro
{
    class RemServer
    {
        public RemServer() 
        {
            IDictionary props = new Hashtable();
            props["port"] = 1234;

            BinaryServerFormatterSinkProvider servProv =
                new BinaryServerFormatterSinkProvider();

            servProv.TypeFilterLevel =
                System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

            TcpChannel chan = new TcpChannel(props, null, servProv);

            ChannelServices.RegisterChannel(chan, false);


            RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemObj),
                "RemObj", WellKnownObjectMode.SingleCall);

            Console.WriteLine("object published..");
            Console.ReadLine();
        }
    }
}
